package com.woniuxy02;

import java.util.Objects;

public class Student {
    private Integer sid;
    private String sname;
    private Integer age;

    public Student() {
    }
    public Student(Integer sid, String sname, Integer age) {
        this.sid = sid;
        this.sname = sname;
        this.age = age;
    }

    public Integer getSid() {
        return sid;
    }

    public void setSid(Integer sid) {
        this.sid = sid;
    }

    public String getSname() {
        return sname;
    }

    public void setSname(String sname) {
        this.sname = sname;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "sid=" + sid +
                ", sname='" + sname + '\'' +
                ", age=" + age +
                '}';
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Student student)) return false;
        return Objects.equals(sid, student.sid) && Objects.equals(sname, student.sname) && Objects.equals(age, student.age);
    }

    @Override
    public int hashCode() {
        return Objects.hash(sid, sname, age);
    }
}
